#include <iostream>
#include <tchar.h>

#include "CheckMACs.h"
#include "Sign.h"

int _tmain(int argc, _TCHAR* argv[])
{
	FILE *file;
	TCHAR mac[100];
	int res;

	file = fopen("macs.txt","rt");
	while ( fscanf(file,"%s", mac) == 1)
	{
		res = Do_CheckMACs(mac, TEXT("macs.dat"));
		if ( res ) _tprintf(TEXT("%s - OK\n"), mac);
		else       _tprintf(TEXT("%s - FAILD!\n"), mac);  

	}

	fclose(file);


	if ( !_tcsicmp( _T("-sign"), argv[1]) )
	{
		printf("\nSign macs.dat file ...\n");
		Sign();
	}
	else if ( !_tcsicmp( _T("-verify"), argv[1]) )
	{
		printf("\nVerify macs.dat file ...\n");
		Verify();
	} 
	else if ( !_tcsicmp( _T("-keys"), argv[1]))
	{
		printf("\nGenerate public and private keses...\n");
		GenKeys();
	} else {
		printf("\nWrong parameters !!!\n");
	}

	return 0;
}